﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ForumsAdmin.ascx.cs" Inherits="Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.ForumsAdmin" %>

<owc:OwGrid ID="ForumsAdmingv" runat="server" SkinID="OwGridAdmin" AutoGenerateColumns="False"
    CellSpacing="0" DataSourceID="ForumsAdminOds" GridLines="None"
    OwEnableMessageDisplay="True" OwMessageDisplayType="InPlace" 
    OwMessageDisplayControl="">
    <MasterTableView DataSourceID="ForumsAdminOds" DataKeyNames="ForumID" >
        <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="<%$OwR:AddNewRecordText %>" RefreshText="<%$ OwR:RefreshText %>"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
        </ExpandCollapseColumn>
        <Columns>
            <owct:GridTemplateColumn HeaderText='<%$ OwR:Code %>'>
                <ItemTemplate>
                    <%# Eval("ForumID") %>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn HeaderText='<%$ OwR:TitleLabel %>'>
                <ItemTemplate>
                    <table width="100%">
                        <tr>
                            <td colspan="2">
                                <a href="#" onclick='return false;'><b><i>
                                    <%# Eval("Title")%></i>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="UserOwR" OwText="UserLabel" runat="server"></owc:OwR>
                            </td>
                            <td>
                                <%#Eval("UserID") != null ? (Membership.GetUser(Eval("UserID")) != null ? Membership.GetUser(Eval("UserID")).UserName : "n/a") : "n/a"%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="CategoryLabelOwR" runat="server" OwText="CategoryLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%#OwCategoriesBLL.OwGetEntity((long?)Eval("CategoryID")).Name %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="DescriptionOwR" runat="server" OwText="DescriptionLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%#Eval("Description")%>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn HeaderText='<%$ OwR:InfoLabel %>'>
                <ItemTemplate>
                    <table width="100%">                        
                                 
                        <tr>
                            <td>
                                <owc:OwR ID="ContinentOwR" runat="server" OwText="ContinentLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("ContinentID").OwToInt64TryParseReturn0()).Name %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="CountryOwR" runat="Server" OwText="CountryLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("CountryID").OwToInt64TryParseReturn0()).Name %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="ProvinceOwR" runat="Server" OwText="ProvinceLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("ProvinceID").OwToInt64TryParseReturn0()).Name %>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="DistrictOwR" runat="Server" OwText="DistrictLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("DistrictID").OwToInt64TryParseReturn0()).Name%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <owc:OwR ID="WardOwR" runat="Server" OwText="WardLabel" OwSuffix=":"></owc:OwR>
                            </td>
                            <td>
                                <%# OwLocalitiesBLL.OwGetEntity(Eval("WardID").OwToInt64TryParseReturn0()).Name%>
                            </td>
                        </tr>                                       
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn HeaderText='<%$ OwR:CommandLabel %>'>
                <ItemTemplate>
                    <table width="100%">
                        <tr>
                            <td>
                                <owc:OwR ID="IsDeletedOwR" runat="Server" OwText="IsDeleted" OwSuffix=":" ></owc:OwR>
                            </td>
                            <td>
                                <owc:OwCheckBox ID="IsDeletedCheckBox" runat="server" Checked='<%#Eval("IsDeleted")%>'
                                    Text='<%# Eval("ForumID") %>' CssClass="HiddenText" OnCheckedChanged="IsDeletedCheckBox_CheckedChanged"
                                    AutoPostBack="true" />
                            </td>
                        </tr>                      
                    </table>
                </ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn AllowFiltering="False" FilterControlAltText="Filter TemplateColumn1 column"
                UniqueName="TemplateColumn1">
                <ItemTemplate>
                    <a href='/Admin/Views/Site/ForumsEdit.aspx?ID=<%#Eval("ForumID")%>'>
                        <img src='/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/edit.gif' runat="server"
                            id="UpdateImage" alt="" /></a></ItemTemplate>
            </owct:GridTemplateColumn>
            <owct:GridTemplateColumn AllowFiltering="False" UniqueName="TemplateColumn">
                <ItemTemplate>
                    <asp:ImageButton CausesValidation="true" onClientClick='if(!confirm("Are you sure to  Delete?")) return false' 
                    ID="EditDeleteButton1" CommandName="Delete" runat="server" SkinID="OwConfirmButton" ImageUrl="/App_Themes/OpenWeb/OwImages/vi-VN/CommandNameIcons/delete.gif" />
                </ItemTemplate>
            </owct:GridTemplateColumn>
        </Columns>
        <EditFormSettings EditFormType="Template">
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
            <FormTemplate>
                <%
                    Response.Redirect("BlogsEdit.aspx");
                %>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
        <WebServiceSettings>
            <ODataSettings InitialContainerName="">
            </ODataSettings>
        </WebServiceSettings>
    </HeaderContextMenu>
</owc:OwGrid>
<owc:OwObjectDataSource ID="ForumsAdminOds" runat="server" DataObjectTypeName="Micronet.OpenWeb.Entity.OwForumsEntity"
    DeleteMethod="OwDelete" InsertMethod="OwInsert" 
    OldValuesParameterFormatString="original_{0}" EnablePaging="True" 
    SelectCountMethod="OwGetByDynamicCount" 
    SelectMethod="OwGetByDynamic" 
    TypeName="Micronet.OpenWeb.Com.BLL.OwForumsBLL" UpdateMethod="OwUpdate">
    <SelectParameters>
        <asp:Parameter DbType="Guid" Name="userID" />
        <asp:Parameter Name="isDeleted" Type="Boolean" />
        <asp:Parameter Name="continentID" Type="Int64" />
        <asp:Parameter Name="countryID" Type="Int64" />
        <asp:Parameter Name="provinceID" Type="Int64" />
        <asp:Parameter Name="districtID" Type="Int64" />
        <asp:Parameter Name="wardID" Type="Int64" />
        <asp:Parameter Name="categoryID" Type="Int64" />
        <asp:Parameter Name="companyID" Type="Int64" />
        <asp:Parameter Name="sortClause" Type="String" />
        <asp:Parameter Name="sortDirection" Type="String" />
        <asp:Parameter Name="startRowIndex" Type="Int32" />
        <asp:Parameter Name="maximumRows" Type="Int32" />
    </SelectParameters>
</owc:OwObjectDataSource>